#ifndef GAME_2048_H
#define GAME_2048_H

#include <stdbool.h>

// 定义
#define MOVE_LEFT 1
#define MOVE_RIGHT 2
#define MOVE_UP 3
#define MOVE_DOWN 4
#define BOARDSIZE 4



// 结构体声明
typedef struct {
    int16_t type;
    int32_t size;
    int16_t reserved1;
    int16_t reserved2;
    int32_t offbytes;
} __attribute__((packed)) header;

typedef struct {
    int32_t size;
    int32_t width;
    int32_t height;
    int16_t planes;
    int16_t bit_count;
    int32_t compression;
    int32_t size_img;
    int32_t xpel;
    int32_t ypel;
    int32_t clrused;
    int32_t partant;
} __attribute__((packed)) info;

// 函数声明
int get_bmpfiles_index(int x);
int get_zero_num(void);
void set_matrix(int z, int s);
void lcd_draw_point(int x, int y, int color);
void lcd_draw_rect(int x0, int y0, int w, int h, int color);
void draw_bmp(const char *bmpfile, int x0, int y0);
void draw_matrix(void);
void init_matrix(void);
void rand_matrix(void);
bool is_game_over(void);
int get_figer_direction(void);
void fin_left(void);
void fin_right(void);
void fin_up(void);
void fin_down(void);
int change_matrix(void);
void show_gif(void);
int game_2048(void);

#endif // GAME_2048_H